<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .before {
            background-color: blueviolet;
            height: 100px;
        }
        .wrapper {
            height: 100px;
            background-color: red;
            float: left;
            width: 100px;
        }
        .box {
            /* width: 100px; */
            height: 100px;
            background-color: red;
        }
    </style>
</head>
<body>
    <div class="before"></div>
    <div class="wrapper"></div>
    <div class="box">123</div>

    <!-- 
        浮动元素只影响他之后的元素
        当设置为浮动之后，display变为block 但是和absolute一样，宽度不会独占一行，需要自己设置
        拥有inline属性的元素可以看到浮动元素，block元素则会插到它的下面
     -->
</body>
</html>